package com.uzai.console.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author mingyang.chen create in 2023/3/29 17:36
 */
@Getter
@AllArgsConstructor
public enum QFriendRequestScene {
    Q_WECHAT_SEARCH(1, "二维码"),
    Q_WECHAT_MOBILE(2, "手机号"),
    Q_WECHAT_SHAR_CARD(3, "名片"),
    Q_WECHAT_GROUP(4, "群内"),

    UN_KNOW(-1, "未知"),


    ;

    private final Integer value;
    private final String label;


    public static QFriendRequestScene getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (QFriendRequestScene type : QFriendRequestScene.values()) {
            if (type.getValue().equals(id)) {
                return type;
            }
        }
        return null;
    }
}
